from csagent.core.node.base_node import BaseNode
from csagent.core.context import AgentState
import time
class Node(BaseNode):
    def initialize(self):
        """初始化节点"""
        print(self.conf)
        print('rag Node初始化成功')
    def execute(self, state: AgentState, stream_writer=None) -> AgentState:
        print(f"rag node开始执行")
        query = state['messages'][-1]['content']
        print(f"query:{query}")
        print("检索中")
        time.sleep(1)
        state['node_context']['evi'] = "检索到的证据"
        print(f"rag node执行完成")
        return state